package test.jd;

import java.util.Scanner;

/**
 * @Description
 * @Author Firenut
 * @Date 2023-08-19 12:04
 */
public class T1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        boolean flagA, flagB;
        int t = in.nextInt();
        int ci = 0;
        while (ci++ < t) {
            flagA = false;
            flagB = false;

            String[] s = new String[3];
            for (int i = 0; i < 3; i++) {
                // ch[i][j] = in.next();
                s[i] = in.next();
            }

            // 扫描行
            for (int i = 0; i < 3; i++) {
                if (s[i].charAt(0) == s[i].charAt(2)
                        && s[i].charAt(0) != s[i].charAt(1)
                        && s[i].charAt(0) != '.'
                        && s[i].charAt(1) != '.') {
                    // 小紫的棋
                    if (s[i].charAt(0) == 'o') {
                        flagA = true;
                    }
                    // 小红的棋
                    if (s[i].charAt(0) == '*') {
                        flagB = true;
                    }
                }
            }

            // 扫描列
            for (int i = 0; i < 3; i++) {
                if (s[0].charAt(i) == s[2].charAt(i)
                        && s[0].charAt(i) != s[1].charAt(i)
                        && s[1].charAt(i) != '.'
                        && s[0].charAt(i) != '.') {
                    // 小紫的棋
                    if (s[0].charAt(i) == 'o') {
                        flagA = true;
                    }
                    // 小红的棋
                    if (s[0].charAt(i) == '*') {
                        flagB = true;
                    }
                }
            }
            if (flagA && flagB) {
                System.out.println("draw");
            } else if (flagA) {
                // 小紫赢
                System.out.println("yukari");
            } else if (flagB) {
                // 小红赢
                System.out.println("kou");
            }
        }
    }

}

/**
 3
 ...
 o*o
 ...
 yukari


 o**
 ooo
 ..*
 kou


 o*o
 *o*
 o*o
 draw
 */